package cn.kgc.form;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

/**
 * @author YC
 * 接收前端的一键登录或注册表单类
 */
@Data
@ApiModel(description = "一键登录或注册的表单")
public class LoginOrRegisterForm {

    @ApiModelProperty(name = "mobile", value = "手机号")
    @Pattern(regexp = "^1[3456789]\\d{9}$", message = "手机号格式不正确")
    @NotBlank(message = "手机号不能为空")
    private String mobile;

    @ApiModelProperty(name = "smsCode", value = "验证码")
    @Pattern(regexp = "^\\d{6}$", message = "验证码格式不正确")
    @NotBlank(message = "验证码不能为空")
    private String smsCode;

}
